package java67_18;

import java.util.Scanner;

public class SelCourse4 {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		System.out.println("请输入课程代码:");
		try {
			int choice = in.nextInt();// 错误在此行
			switch (choice) {
			case 1:
				System.out.println("C#");
				break;
			case 2:
				System.out.println("java");
				break;
			case 3:
				System.out.println("db");
				break;
			case 4:
				System.out.println("没有此课程!");
				break;
			}
		} catch (NullPointerException e) {
			System.out.println("输入错误,具体信息是:" + e);
			e.printStackTrace();
		} finally {// 无论如何都执行
			System.out.println("选课结束了");
		}

	}

}
